import config from "@/config"
import http from "@/utils/request"

export default {
  getHomepopList: {
    url: `${config.API_URL}/ms/cms/smartPopup/list`,
    name: "获取推送列表",
    get: async function(params){
      return await http.get(this.url, params)
    }
  },
  getHomepopInfo: {
    url: `${config.API_URL}/ms/cms/smartPopup/info/`,
    name: "推送详情",
    get: async function(id){
      return await http.get(this.url + id)
    }
  },
  postHomepopInfo: {
    url: `${config.API_URL}/ms/cms/smartPopup/save`,
    name: "添加推送",
    post: async function(data){
      return await http.post(this.url, data)
    }
  },
  putAuditPass: {
    url: `${config.API_URL}/ms/cms/smartPopup/passAudit/`,
    name: "审核推送通过",
    put: async function(id){
      return await http.put(this.url + id)
    }
  },
  putAuditReject: {
    url: `${config.API_URL}/ms/cms/smartPopup/rejected/`,
    name: "审核推送拒绝",
    put: async function(id){
      return await http.put(this.url + id)
    }
  },
  getTestUserList: {
    url: `${config.API_URL}/ms/cms/notifications/list/userTest`,
    name: "获取测试用户列表",
    get: async function(params){
      return await http.get(this.url, params)
    }
  },
  putCancelHomepop: {
    url: `${config.API_URL}/ms/cms/smartPopup/canceled/`,
    name: "取消推送",
    put: async function(id){
      return await http.put(this.url + id)
    }
  },
  getEstimatedPushCount: {
    url: `${config.API_URL}/ms/cms/notifications/getEstimatedPushCount`,
    name: "获取推送预估人数",
    get: async function(params){
      return await http.get(this.url, params)
    }
  },
  putHomepopData: {
    url: `${config.API_URL}/ms/cms/smartPopup/updateSort/`,
    name: "更新排序",
    put: async function(id, params){
      return await http.put(this.url + id, params,{
				headers: {
					'Content-Type': 'multipart/form-data'
				}
			})
    }
  },
  
  
}